<?php
/**
 * @Copyright Copyright (C) 2010-2012
 * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
 + Created by:          Webit Solution
 * Company:		Webit Solution
 + Contact:		www.webits.asia, developer@webits.asia
 * Created on:	Mar 21, 2012
 ^
 + Project: 		WRecruit
 * File Name:	views/employer/tmpl/jobsearch.php
 ^ 
 * Description: template for job search
 ^ 
 * History:		NONE
 ^ 
 */

defined('_JEXEC') or die('Restricted access');

jimport('joomla.html.pane');

$editor = & JFactory :: getEditor();

global $mainframe;
Utilities::multipleSelected();
?>
<script type="text/javascript">
//		jQuery.noConflict();
jQuery(function(){			
	jQuery("select#jobcategory").multiselect({
		header: "Industries",
		selectedText:"# of # Industries",
		noneSelectedText: 'Select industries'
		//,selectedList: 4	
	});
	jQuery('#cvtitle').focus(function (){
		if (jQuery(this).val().toLowerCase() == 'cv title...')
		{
			jQuery(this).val("");
		}
	});
	jQuery('#cvtitle').blur(function (){
		if (jQuery(this).val().toLowerCase() == '')
		{
			jQuery(this).val("CV Title...");
		}
	});
	jQuery('#candidatename').focus(function (){
		if (jQuery(this).val().toLowerCase() == 'candidate name...')
		{
			jQuery(this).val("");
		}
	});
	jQuery('#candidatename').blur(function (){
		if (jQuery(this).val().toLowerCase() == '')
		{
			jQuery(this).val("Candidate Name...");
		}
	});		
});
</script>
<?php 
$document = &JFactory::getDocument();
//$document->addScript( JURI::base() . '/includes/js/joomla.javascript.js');
$document->addStyleSheet('components/com_wrecruit/css/'.$this->config['theme']);

JHTML :: _('behavior.calendar');
$width_big = 40;
$width_med = 25;
$width_sml = 15;
?>
<?php if ($this->config['offline'] == '1'){ ?>
<table cellpadding="0" cellspacing="0" border="0" width="100%" >
	<tr><td valign="top" class="<?php echo $this->theme['title']; ?>" >	<?php echo $this->config['title']; ?></td></tr>
	<tr><td height="25"></td></tr>
	<tr><td class="wrecruitmsg">
		<?php echo $this->config['offline_text']; ?>
	</td></tr>
</table>	
<?php }else{ 
if ($this->userrole->rolefor == 1) { // employer
?>

	<div style="padding: 10px 0 10px 10px;border: 1px solid #e1e1e1">
		<div style="float: left;width: 175px;" class="b-leftcontent employer-panel">			
			<?php require_once(JPATH_COMPONENT.DS.'views'.DS.'employer'.DS.'tmpl'.DS.'left_panel.php');?>
		</div>
			<!--
			<?php 
			/*if (sizeof($this->employerlinks) != 0){				
				echo '<ul>';
				foreach($this->employerlinks as $lnk)	{*/ ?>
					<li class="b-left-list" <?php /*if($lnk[2] == 1)echo 'class="first"'; elseif($lnk[2] == -1)echo 'class="last"';  */?>>
						<a href="<?php echo $lnk[0]; ?>"> <?php echo $lnk[1]; ?></a>
					</li>
				<?php /*}
				echo '</ul>';			
			}*/
			?>
			-->		
		<div style="float: right;width: 75%">
        <table cellpadding="0" cellspacing="0" border="0" width="100%" >
            <!--<tr><td valign="top" class="<?php echo $this->theme['title']; ?>" >	
                <?php //echo $this->config['title']; ?>
            </td>
            </tr>
            <tr><td height="23"></td></tr>-->
            <?php /*if ($this->config['cur_location'] == 1) {?>
            <tr><td class="curloc">
                <?php echo JText::_('JS_CUR_LOC'); ?> : <?php echo JText::_('JS_SEARCH_RESUME'); ?>
            </td></tr>
            <?php } */?>
            <tr><td>
                    <?php 
                    /*if (sizeof($this->employerlinks) != 0){
                        echo '<div id="toplinks"><ul>';
                        foreach($this->employerlinks as $lnk)	{ ?>
                            <span <?php if($lnk[2] == 1)echo 'class="first"'; elseif($lnk[2] == -1)echo 'class="last"';  ?>>
                                <a href="<?php echo $lnk[0]; ?>"> <?php echo $lnk[1]; ?></a>
                            </span>
                        <?php }
                        echo '<ul></div>';			
                    }*/
                    ?>
            </td>
            </tr>	
            <!--	<tr><td height="3"></td></tr>-->
            <tr><td class="<?php //echo $this->theme['heading']; ?>" align="left">
                <div class="head-title">
                    <h2><?php echo JText::_('Search for CV you want') ?></h2>
                </div>				
            </td></tr>
            <tr><td height="10"></td></tr>
        </table>
<?php	
	/*if($this->canview == 0){			
			echo "<font color='red'><strong>" . JText::_('JS_YOU_CAN_NOT_VIEW_RESUME_SEARCH_FORM') . "</strong></font>";
    }*/    
//if ($printform == 1) {
//	echo "tes";
//$this->userrole->rolefor = 1;
//$this->searchresumeconfig['search_resume_title'] = 1;
//$this->searchresumeconfig['search_resume_name'] = '1';
//$this->searchresumeconfig['search_resume_nationality']= 1;
//$this->searchresumeconfig['search_resume_gender']= 1;
//$this->searchresumeconfig['search_resume_available']= 1;
//$this->searchresumeconfig['search_resume_category']= 1;
//$this->searchresumeconfig['search_resume_type']= 1;
//$this->searchresumeconfig['search_resume_salaryrange']= 1;
//$this->searchresumeconfig['search_resume_heighesteducation']= 1;
//$this->searchresumeconfig['search_resume_experience']= 1;

?>
<form action="<?php echo JRoute::_('index.php?option=com_wrecruit&c=wrecruit&view=employer&layout=resume_searchresults&Itemid='.$this->Itemid); ?>" method="post" name="adminForm" id="adminForm">
	
	    <table cellpadding="5" cellspacing="0" border="0" width="100%" class="adminform">
	      <?php if ( $this->searchresumeconfig['search_resume_title'] == '1' ) { ?>
					  <tr>
						<!--<td width="20%" align="right"><?php echo JText::_('JS_CV_TITLE'); ?>...</td>-->						
						<td colspan="2"><input id="cvtitle" style="width: 99%" class="text" value="<?php echo JText::_('JS_CV_TITLE'); ?>..." type="text" name="title" size="40" maxlength="255"  /></td>
					  </tr>
	       <?php } ?>
	      <?php if ( $this->searchresumeconfig['search_resume_name'] == '1' ) { ?>
					  <tr>
						<!--<td width="20%" align="right"><?php echo JText::_('JS_CANDIDATE_NAME'); ?></td>-->						  
						  <td colspan="2"><input id="candidatename" style="width: 99%" class="text" value="<?php echo JText::_('JS_CANDIDATE_NAME'); ?>..." type="text" name="name" size="40" maxlength="255"  />
						</td>
					  </tr>
	       <?php } ?>
		      <?php if ( $this->searchresumeconfig['search_resume_nationality'] == '0' ) { ?>
					  <tr>
						<td align="left" width="15%"><?php echo JText::_('JS_NATIONALITY'); ?></td>
						<td><?php echo $this->searchoptions['nationality']; ?>
						</td>
					  </tr>
	       <?php } ?>
	      <?php if ( $this->searchresumeconfig['search_resume_gender'] == '1' ) { ?>
					<tr>
						<td  width="30%" align="left" class="textfieldtitle">	<?php echo JText::_('JS_GENDER');  ?>	</td>
						<td><?php echo $this->searchoptions['gender'];	?>	</td>
					</tr>
	       <?php } ?>
	       <?php if ( $this->searchresumeconfig['search_resume_type'] == '1' ) { ?>
					  <tr>
						<td align=left><?php echo JText::_('JS_AVAILABLE_FOR'); ?></td>
						<td><?php echo $this->searchoptions['jobtype']; ?></td>
					  </tr>
		  <?php } ?>
	      <?php if ( $this->searchresumeconfig['search_resume_available'] == '1' ) { ?>
					<tr>
						<td align="left"></td>
						<td><input type='checkbox' name='iamavailable' value='1' <?php if(isset($this->resume)) echo ($this->resume->iamavailable == 1) ? "checked='checked'" : ""; ?> /><?php echo JText::_('JS_AVAILABLE_DEMEND'); ?></td>
					</tr>
	 	  <?php } ?>
	      <?php if ( $this->searchresumeconfig['search_resume_category'] == '1' ) { ?>
					 <tr>
						<td align="left"><?php echo JText::_('JS_INDUSTRIES'); ?></td>
						<td><?php echo $this->searchoptions['jobcategory']; ?></td>
					  </tr>
		   <?php } ?>      
	      <?php if ( $this->searchresumeconfig['search_resume_salaryrange'] == '1' ) { ?>
					  <tr>
						<td align="left"><?php echo JText::_('JS_SALARYRANGEUS'); ?></td>
						<td><?php //echo $this->searchoptions['currency'];  ?><?php echo $this->searchoptions['jobsalaryrange']; ?></td>
					  </tr>
	       <?php } ?>
	      <?php if ( $this->searchresumeconfig['search_resume_heighesteducation'] == '1' ) { ?>
					   <tr>
						<td align="left"><?php echo JText::_('JS_HEIGHTESTEDUCATION'); ?></td>
						<td><?php echo $this->searchoptions['heighestfinisheducation']; ?></td>
					  </tr>
	       <?php } ?>
	      <?php if ( $this->searchresumeconfig['search_resume_experience'] == '1' ) { ?>
					   <tr>
						<td align="left"><?php echo JText::_('JS_EXPERIENCE'); ?></td>
						<td><input class="inputbox" type="text" name="experience" size="25" maxlength="15"  /></td>
					  </tr>
	      <?php } ?>
	
		<tr>
			<td></td>
			<td align="left">
				<button class="gradient-button-yellow" type="submit"><?php echo JText::_('JS_SEARCH'); ?></button>
				<!--<a class="submitClasss" onclick="document.adminForm.submit()"><?php echo JText::_('JS_SEARCH'); ?></a>-->
				<!-- <input type="submit" class="submitClass" name="submit_app" value="<?php echo JText::_('JS_SEARCH'); ?>" /> -->
			</td>
		</tr>
	    </table>	    
			<input type="hidden" name="isresumesearch" value="1" />
			<input type="hidden" name="view" value="employer" />
			<input type="hidden" name="layout" value="resume_searchresults" />
			<input type="hidden" name="uid" value="<?php echo $this->uid; ?>" />
			<input type="hidden" name="option" value="<?php echo $this->option; ?>" />
			<input type="hidden" name="task11" value="view" />
		</form>
	</div>    
    <div style="clear: both"></div>
</div>		
<?php
} else{ // not allowed employer
	//Update by Vireak on 28/06/2012
	//Add frame to this warning and some styling
	//---------------------
	echo '<div class="box-list"><div class="head-title"><h2>Oop!</h2></div>';
	echo '<span class="wr_info"><p>'.JText::_('JS_YOU_ARE_NOT_ALLOWED_TO_VIEW').'</p>';
	echo '<p>This page is reserved for the authorized employers or recruiters only. </p></span>';
	echo '</div>';
	//---------------------
}	
//}
}//ol
?>	
<div width="100%">
<?php 
if($this->config['fr_cr_txsh']) {
	echo 
	'<table width="100%" style="table-layout:fixed;">
		<tr><td height="15"></td></tr>
		<tr><td style="vertical-align:top;" align="center">'.$this->config['fr_cr_txa'].$this->config['fr_cr_txb'].'</td></tr>
	</table>';
}	
?>
</div>
